package com.classes.method;

/**
 * @author chuer
 * @version V1.0
 * @Description: 字段访问标识
 * @date 2015年4月24日 上午10:37:52
 */
public enum MethodAccessFlagEnum {
    ACC_PUBLIC(0x0001),
    ACC_PRIVATE(0x0002),
    ACC_PROTECTED(0x0004),
    ACC_STATIC(0x0008),
    ACC_FINAL(0x0010),
    ACC_SYNCHRONIZIED(0x0020),
    ACC_BRIDGE(0x0040),
    ACC_VARARGS(0x0080),
    ACC_NATIVE(0x0100),
    ACC_ABSTRACT(0x0400),
    ACC_SYNTHETIC(0x1000),;

    private int flag;

    private MethodAccessFlagEnum(int flag) {
        this.flag = flag;
    }

    public int getFlag() {
        return this.flag;
    }

    public static MethodAccessFlagEnum getFlag(int flag) {
        for (MethodAccessFlagEnum fafe : MethodAccessFlagEnum.values()) {
            if (fafe.getFlag() == flag) {
                return fafe;
            }
        }
        return null;

    }

}
